﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BGMove : MonoBehaviour {

    public float Speed;

    private void FixedUpdate()
    {
        Vector2 pos = gameObject.GetComponent<RectTransform>().anchoredPosition;
        pos.x -= Speed * Time.deltaTime;
        if (pos.x < -2000)
        {
            pos.x += 2000 * 3;
        }
        gameObject.GetComponent<RectTransform>().anchoredPosition = pos;
    }
}
